#!/bin/bash

LOCK="/tmp/sshtunnel.lock"
CMD="ssh -fNR 2201:localhost:22 anton@remote_host"
[ -f "$LOCK" ] && exit
for ((;;));
do
	touch $LOCK
	ps -ef|grep ssh|grep "${CMD}" > /dev/null 2>&1
	[ $? -ne 0 ] && $CMD
	sleep 10s
done
